using System.Collections;
using System.Xml;
using System;

public static class XMLTools
{
	public static XmlDocument getNewXMLDocument(string path)
	{
		XmlDocument xmlDoc = new XmlDocument();
		xmlDoc.Load(path);
		return xmlDoc;
	}

	// extension method on XmlNode
	public static string GetAttribute(this XmlNode node, string name, string defval = null)
	{
		XmlAttribute attr = node.Attributes[name];
		return attr != null ? attr.Value : defval;
	}
}
